--variables
local Servername = "Gameweb - Server #1"
--end of variables
function Register(ply)
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( (ScrW()/2) - 100,(ScrH()/2) - 85 )
DermaPanel:SetSize( 200, 170 )
DermaPanel:SetTitle( "Register" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false )
DermaPanel:ShowCloseButton( false )
DermaPanel:MakePopup()
		
		local myLabel= vgui.Create("DLabel", Name)
		myLabel:SetParent( DermaPanel )
		myLabel:SetPos(5,80)
		myLabel:SetText("Username:")
		myLabel:SizeToContents()
		local myLabel2= vgui.Create("DLabel", Pass)
		myLabel2:SetParent( DermaPanel )
		myLabel2:SetPos(5,105)
		myLabel2:SetText("Password:")
		myLabel2:SizeToContents()
		local myLabel3= vgui.Create("DLabel", Pass)
		myLabel3:SetParent( DermaPanel )
		myLabel3:SetPos(5,30)
		myLabel3:SetText("Welcome to ".. Servername .."\nEnter the Username and Password\nyou want to use!")
		myLabel3:SizeToContents()
 
local Name = vgui.Create( "DTextEntry", DermaPanel )
Name:SetParent( DermaPanel )
Name:SetPos( 60,80 )
Name:SetTall( 20 )
Name:SetWide( 130 )
--Name:GetValue()
 
local Pass = vgui.Create( "DTextEntry", DermaPanel )
Pass:SetParent( DermaPanel )
Pass:SetPos( 60,105)
Pass:SetTall( 20 )
Pass:SetWide( 130 )
--Pass:GetValue()

local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( DermaPanel ) -- Set parent to our "DermaPanel"
DermaButton:SetText( "Register" )
DermaButton:SetPos( 50, 130 )
DermaButton:SetSize( 100, 30 )
DermaButton.DoClick = function ()
DermaButton.DoClick = function()
	local name,pass = Name:GetValue(), Pass:GetValue()
	if name != "" and pass != "" then 
		RunConsoleCommand("adduserdb", Name:GetValue(), Pass:GetValue(),"elgjdr25753")
		DermaPanel:Close()
	end
end
end
end
concommand.Add("register", Register)